home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Taifun / Taifun 007 (1987-02-15)(Ossowski, Stefan)(DE)(PD).zip / Taifun 007 (1987-02-15)(Ossowski, Stefan)(DE)(PD).adf / C Compiler / gen.h < prev    next >
C/C++ Source or Header  |  1987-03-04  |  2KB  |  49 lines

  1. enum e_am {
  2.         am_dreg, am_areg, am_ind, am_ainc, am_adec, am_indx, am_indx2,
  3.         am_xpc, am_direct, am_immed, am_mask, am_none, am_indx3 };
  4.  
  5.  
  6. enum e_op {
  7.         op_move, op_moveq, op_add, op_addi, op_addq, op_sub, op_subi,
  8.         op_subq, op_muls, op_mulu, op_divs, op_divu, op_and, op_andi,
  9.         op_or, op_ori, op_eor, op_asl, op_asr, op_jmp, op_jsr, op_movem,
  10.         op_rts, op_bra, op_beq, op_bne, op_blt, op_ble, op_bgt, op_bge,
  11.         op_bhi, op_bhs, op_blo, op_bls, op_tst, op_ext, op_lea, op_swap,
  12.         op_neg, op_not, op_cmp, op_clr, op_link, op_unlk, op_label,
  13.         op_pea, op_cmpi, op_dc };
  14.  
  15. /*
  16.  *      code generation structures and constants
  17.  */
  18.  
  19. #define F_DREG  1       /* data register direct mode allowed */
  20. #define F_AREG  2       /* address register direct mode allowed */
  21. #define F_MEM   4       /* memory alterable modes allowed */
  22. #define F_IMMED 8       /* immediate mode allowed */
  23. #define F_ALT   7       /* alterable modes */
  24. #define F_DALT  5       /* data alterable modes */
  25. #define F_ALL   15      /* all modes allowed */
  26. #define F_VOL   16      /* need volitile operand */
  27. #define F_NOVALUE 32    /* dont need result value */
  28.  
  29. /*      addressing mode structure       */
  30.  
  31. struct amode {
  32.         enum e_am       mode;
  33.         char            preg;
  34.         char            sreg;
  35.         char            tempflag;
  36.         int             deep;           /* stack depth on allocation */
  37.         struct enode    *offset;
  38.         };
  39.  
  40. /*      output code structure   */
  41.  
  42. struct ocode {
  43.         struct ocode    *fwd, *back;
  44.         enum e_op       opcode;
  45.         short           length;
  46.         struct amode    *oper1, *oper2;
  47.         };
  48.  
  49.